package com.exposit.books.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.exposit.books.service.IncomeService;

@Controller
@RequestMapping("/income")
public class IncomeController {

	@Autowired
	private IncomeService incomeService;
	@RequestMapping(value = "/income", method = RequestMethod.GET)
	public ModelAndView getBookId(Model model) {
		return id;
	}
	@RequestMapping(value = "/income", method = RequestMethod.POST)
	public String showIncome(Model model) {
		Long income = incomeService.getIncomeById(id);
		model.addAttribute("income", income);

		return "income";
		
	}
}
